package com.sm.tool.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @program: practice
 * @description:
 * @author: liqitian.
 * @create: 2019-12-02 16:07
 **/
@Data
@ApiModel
public class ActivityTicketsDetails {

    @ApiModelProperty(value = "优惠卷id",example ="1231231" ,required = true)
    private Long id;

    @Length(min = 4, max = 20, message = "ticket_name 4-20位")
    @ApiModelProperty(value = "优惠卷名称",example ="中秋好礼券" ,required = true)
    private String ticketName;

    @ApiModelProperty(value = "优惠卷code(只能事中文加英文的组合)" ,example ="qk2sz3445454ds" ,required = true)
    @Pattern(regexp="^\\w+$",message = "优惠卷code(只能事中文加英文的组合)")
    private String ticketCode;

    @DecimalMax("2")
    @DecimalMin("0")
    @ApiModelProperty(value = "0:满减券,1:折扣券,2:立减券",example ="0",required = true )
    private int type;


    @ApiModelProperty(value = "此处活动包含该优惠券张数",example ="0",required = true )
    private int number;


    @DecimalMax("1")
    @DecimalMin("0")
    @ApiModelProperty(value = "能使用该券的用户类型. 0:不限制,1新用户(默认为0)",example ="1",required = true)
    private int useUserType;

    @Range(min = 1,max = 99,message = "最多领取张数不能大于100张")
    @ApiModelProperty(value = "每人最多领取多少张",example ="10",required = true)
    private int  maxReceive;

    @Range(min = 1,max = 999,message = "最多领取张数不能大于100张")
    @ApiModelProperty(value = "有效期",example ="30,表示领取30后过期。0表示不限制",required = true)
    private int  termOfValidity;


    @ApiModelProperty(value = "满减券策略，50,20,表示满50减20",example ="50,20",required = false)
    @Length(min = 4, max = 8, message = "满减券策略，只能是xx,xx格式")
    private String fullRed;

    @ApiModelProperty(value = "折扣卷策略，8表示8折",example ="8",required = false)
    @DecimalMax("0.99")
    @DecimalMin("0.1")
    private BigDecimal discount;

    @ApiModelProperty(value = "立减卷策略，20表示减20",example ="20",required = false)
    private Integer verticalReduction;


    @ApiModelProperty(value = "使用说明",example ="XXXXX",required = true)
    private String  explains;

}
